﻿using Acme.BookStore.Model;
using Acme.BookStore.Model.UserQinjia;
using Acme.BookStore.RBACDTO.MenusDTO;
using Acme.BookStore.RBACDTO.RoleDTO;
using Acme.BookStore.RBACDTO.RoleMenusDTO;
using Acme.BookStore.RBACDTO.UserDTO;
using Acme.BookStore.RBACDTO.UserRoleDTO;
using Acme.BookStore.WorkflowDTO.WorkflowLeaveslipDTO;
using AutoMapper;

namespace Acme.BookStore
{
    public class BookStoreApplicationAutoMapperProfile : Profile
    {
        public BookStoreApplicationAutoMapperProfile()
        {
            /* You can configure your AutoMapper mapping configuration here.
             * Alternatively, you can split your mapping configurations
             * into multiple profile classes for a better organization. */
           
            #region  RBAC  AutoMapper
            //  账号 
            CreateMap<CreateUpdateUserDTO, User>();
            CreateMap< User ,  UserShowDTO> ();
            // 菜单表 
            CreateMap<CreateUpdateMenusDTO , Menus>();
            CreateMap< Menus , MenusShowDTO >();
            // 角色表 
            CreateMap<Role, RoleShowDTO>();
            CreateMap< CreateUpdateRoleDTO , Role>();
            // 角色用户 关系表 
            CreateMap< UserRole , UserRoleShowDTO >();
            CreateMap<CreateUpdateUserRoleDTO , UserRole>();
            // 角色菜单 关系表 
            CreateMap<RoleMenus, RoleMenusShowDTO>();
            CreateMap<CreateUpdateRoleMenusDTO, RoleMenus >();
            #endregion

            #region 审批流程 请假条 

            CreateMap<Leaveslip , LeaveslipShowDTO>();
            CreateMap< CreateUpdateLeaveslipDTO, Leaveslip > ();
            
            #endregion

        }
    }
}
